package com.xiaoyu.lanling.feature.board.model

import `in`.srain.cube.request.JsonData
import `in`.srain.cube.views.list.ListPositionedItemBase
import com.xiaoyu.base.model.User
import com.xiaoyu.lanling.media.image.UserImageLoadParam

class BoardItem constructor(position: Int, val jsonData: JsonData) : ListPositionedItemBase(position) {

    val rank = position.toString()
    val user = User.fromJson(jsonData)
    val index = jsonData.optString("countName") + jsonData.optString("count")
    val loadParam = UserImageLoadParam
            .UserImageLoadParamBuilder()
            .setUserAndDPRound(
                    User.fromJson(jsonData),
                    if (position == 0) 94 else 62)
            .build()

    override fun getViewType() = 0
}